import java.util.Scanner;

public class MoneyChange {
    public static void main(String[] args) {

        int money;
        Scanner sc = new Scanner(System.in);
        while(true){
            System.out.println("请输入金额：");
            money =sc.nextInt();
            if(money>=0 && money<=9999999){
                break;
            }
            else{
                System.out.println("金额无效！");
            }
        }

        String moneystr="";
       while(true){
           int ge=money % 10;
           String number=change(ge);
            moneystr=number+moneystr;
           money=money/10;
           if(money==0){
               break;
           }
       }


        int count=7-moneystr.length();
        for (int i = 0; i < count; i++) {
            moneystr="零"+ moneystr;

        }
        System.out.println(moneystr);
        String []arr = {"佰","拾","万","仟","佰","拾","元"};
        for (int i = 0; i < moneystr.length(); i++) {
            char c = moneystr.charAt(i);
            System.out.print(c + arr[i]);
        }

    }

    public static String change(int number){
        String [] Daxie ={"零","壹","贰","叁","肆","伍","陆","柒","捌","玖","拾"};
        return Daxie[number];
    }
}
